<p id="notice"><%= notice %></p>
<p>
  <b><%= t :hinhanhbia %>:</b>
  <br><br>
  <% @aa = ProductImage.find_by_product_id(@product.product_id) %>
  <% if (@aa!=nil)%>
  <% @bb = @aa.image%>
  <%= image_tag(@bb, :height => '250', :width => '300') %>
  <%end%>
</p>
<p>
  <%= @product.Name %>
</p>

<p>
  <b><%= t :gia %>:</b>
  <%= @product.Price %>
</p>

<p>
  <b><%= t :mota %>:</b>
  <%= simple_format(@product.Description) %>
</p>


<p>
  <b><%= t :theloai %>:</b>
  <%= Category.find(@product.category_id).Name %>
</p>

<p>
  <a href="<%=@url_phat%>/shopcarts/new" ><img src="/images/buy/buy_now.jpg" alt="Buy" width="150" height="30"/>
        
      </a><br/>
</p>

<% if((session[:user_id])!=nil) %>
      <% @user = User.find(session[:user_id]) %>
      <% if(@user.GroupUserId==10) %>
        <td><p><%= link_to "#{t :edit}", edit_product_path(@product) %></td>|
        <td><%= link_to "#{t :destroy}", @product, confirm: 'Are you sure?', method: :delete %></td></p>
      <%end%>   
<%end%>
<p><%= link_to "#{t :quaylai}", products_path %></p>


<!-- Phat: Viet code hien thi ra cac nuoc uong cung the loai -->
<% @cate_id = @product.category_id%>
<% @similar = Product.find(:all, :conditions =>['category_id LIKE?', "#{@cate_id}"] ) %>
<% if(@similar.count > 1)%>
  <h2><font color="a3bc3fc" size = "4"> <%= t :kqtuongtu%></font></h2>
  <main>
    <% @count = 0 %>
    <div class="abox">
        <%@similar.each do |simi|%>
          <% @aa = ProductImage.find_by_product_id(simi.product_id) %>
          <% if (@bb!=nil)%>
            <% @bb = @aa.image%>
            <% @count = @count + 1%>
            <%if(simi.product_id!= @product.product_id && @count < 17)%>
              <%= link_to image_tag(@bb, :height => '156', :width => '167', :alt =>"#{simi.Name}"), simi %>
            <%end%>
          <%end%>
        <%end%>
    </div>   
  </main>
<%end%>
<!-- Phat: End hien thi cung the loai -->
